//
//  LineDetailTableCell.m
//  MiaoTu
//
//  Created by dllo on 16/9/9.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LineDetailTableCell.h"

@implementation LineDetailTableCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initLayout];
    }
    return self;
}

- (void)initLayout {
    _rootLayout = [MyRelativeLayout new];
    _rootLayout.topPadding = 5;
    _rootLayout.bottomPadding = 5;
    
    _rootLayout.widthDime.equalTo(self.contentView.widthDime);
    _rootLayout.wrapContentHeight = YES;
    [self.contentView addSubview:_rootLayout];
    
    _titleLabel = [UILabel new];
    _titleLabel.heightDime.equalTo(@44);
    _titleLabel.widthDime.equalTo(_rootLayout.widthDime).multiply(1/4.0);
    _titleLabel.topPos.equalTo(_rootLayout.topPos);
    _titleLabel.leftPos.equalTo(_rootLayout.leftPos).offset(10);
    [_rootLayout addSubview:_titleLabel];
    
    _valueLabel = [UILabel new];
    _valueLabel.centerYPos.equalTo(_rootLayout.centerYPos);
    _valueLabel.rightPos.equalTo(_rootLayout.rightPos);
    _valueLabel.leftPos.equalTo(_titleLabel.rightPos);
    _valueLabel.numberOfLines = 0;
    _valueLabel.flexedHeight = YES;
    [_rootLayout addSubview:_valueLabel];
    
    _orangeView = [UIView new];
    _orangeView.centerYPos.equalTo(_rootLayout.centerYPos);
    _orangeView.leftPos.equalTo(_rootLayout.leftPos);
    _orangeView.heightDime.equalTo(_rootLayout.heightDime).multiply(1/2.0);
    _orangeView.widthDime.equalTo(@2);
    [_rootLayout addSubview:_orangeView];
    _orangeView.hidden = YES;
    _orangeView.backgroundColor = [UIColor orangeColor];
    
    _grayView = [UIView new];
    _grayView.topPos.equalTo(_valueLabel.bottomPos).offset(15);
    _grayView.leftPos.equalTo(_titleLabel.rightPos);
    _grayView.rightPos.equalTo(_rootLayout.rightPos);
    _grayView.heightDime.equalTo(@1);
    [_rootLayout addSubview:_grayView];
    _grayView.backgroundColor = [UIColor colorWithWhite:0.788 alpha:1.000];
}

- (void)awakeFromNib {
    // Initialization code
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
